package ro.isdc.training.ejb3.systemuser.service.domain;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import ro.isdc.training.ejb3.misc.service.domain.ServiceRequest;
import ro.isdc.training.ejb3.systemuser.domain.SystemUser;

/**
 * Service request for the createSystemUser() service
 * 
 * @author Andrei Chirila
 */
public class CreateSystemUserRequest extends ServiceRequest {

  /**
   * Generated Serial Version UID
   */
  private static final long serialVersionUID = -7884371255706630528L;
  
  /**
   * The System user to create
   */
  private SystemUser systemUser;

  /**
   * @return the systemUser
   */
  public SystemUser getSystemUser() {
    return systemUser;
  }

  /**
   * @param systemUser the systemUser to set
   */
  public void setSystemUser(final SystemUser systemUser) {
    this.systemUser = systemUser;
  }

  /**
   * @see java.lang.Object#equals(Object)
   */
  public boolean equals(final Object object) {
    if (object == this) {
      return true;
    }
    if (!(object instanceof CreateSystemUserRequest)) {
      return false;
    }
    CreateSystemUserRequest rhs = (CreateSystemUserRequest) object;
    return new EqualsBuilder().append(this.systemUser, rhs.systemUser)
        .isEquals();
  }

  /**
   * @see java.lang.Object#toString()
   */
  public String toString() {
    return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append(
        "systemUser", this.systemUser).toString();
  }

}
